
import request from '@/utils/request';
import { parseStrEmpty } from '@/utils/ruoyi';
// 查询顾客列表
export function listCustomers(query) {
  return request({
    url: '/customer/customer/list',
    method: 'get',
    params: query
  })
}


// 模糊查询顾客列表
export function searchCustomers(customerName) {
  return request({
    url: '/customer/customer/select',
    method: 'get',
    params: customerName
  });
}



// 查询顾客详细
export function getCustomer(customerId) {
  return request({
    url: '/customer/customer/' + parseStrEmpty(customerId),
    method: 'get'
  })
}

// 新增顾客
export function addCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'post',
    data: data
  })
}

// 修改顾客
export function updateCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'put',
    data: data
  })
}

// 删除顾客
export function deleteCustomerById(customerId) {
  return request({
    url: '/customer/customer/' + customerId,
    method: 'delete'
  })
}

// 修改顾客状态
export function changeCustomerStatus(customerId, status) {
  return request({
    url: `/customer/customer/changeStatus/${customerId}`,
    method: 'put',
    params: { status }
  });
}



